<?php


namespace app\backend\validate;


use think\Validate;

class BuyersStoryValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'desc' => 'require',
        'family' => 'require',
        'place' => 'require',
        'methods' => 'require',
        'models' => 'require',
        'url' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'desc.require' => '请输入简介！',
        'family.require' => '请输入家庭！',
        'place.require' => '请输入地点！',
        'methods.require' => '请输入方式！',
        'models.require' => '请输入型号！',
        'url.require' => '请输入路径！',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'create' => ['desc', 'family', 'models', 'url', 'place', 'methods'],
        'update' => ['desc', 'family', 'models', 'url', 'place', 'methods']
    ];
}